import java.util.Scanner;

public class Answer1 {
    //字符串中找连续最长的数字串
    //https://www.nowcoder.com/practice/bd891093881d4ddf9e56e7cc8416562d?tpId=182&tqId=34785&ru=/exam/oj

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            String s = in.nextLine();
            char[] ch = s.toCharArray();
            int n = ch.length;
            int len = 0;
            int begin = 0;
            for (int left = 0; left < n; left++) {
                if (ch[left] >= '0' &&  ch[left] <= '9' ) {
                    int right = left;
                    while (right <n && ch[right] >= '0' &&  ch[right] <= '9') {
                        right++;
                    }
                    if (len < right - left) {
                        begin = left;
                        len =right - left;
                    }

                    left = right;
                }
            }
            for(int i=begin;i<begin+len;i++){
                System.out.print(ch[i]);
            }
        }
    }

}
